/*
 * @(#)TradeStatus.java 创建于 2016-07-15 13:04:53
 *
 * 版权：版权所有 Bsoft 保留所有权力。
 */
package com.bsoft.gol.hcb.utils;

/**
 * @author <a href="mailto:chinnsii@163.com">zhengshi</a>
 */
public enum TradeStatus {

    //FIXME 此处配置作废  不再使用  代码迁移至hcn-pay !!!!!!!!!!!!!!!!!!!!!!

    toBePayed("01", "待付款"), expired("02", "过期"), canceled("03", "取消"), refunding("04", "退款中"), refunded("05", "已退款"),
    successful("06", "支付成功"), failed("07", "支付失败"), payedButHospitalFailed("08", "已支付, 医院端处理失败"), appSucceed("09", "app端成功"),
    hcnFailed("10", "hcn处理失败。");

    private String code;
    private String display;

    TradeStatus(String code, String display) {
        this.code = code;
        this.display = display;
    }

    public String getCode() {
        return code;
    }

    public String getDisplay() {
        return display;
    }

    public static TradeStatus getTradeStatus(String code) {
        int i = Integer.parseInt(code);
        if (i < 1 || i > values().length) {
            return null;
        }
        return values()[i - 1];
    }
}
